<?php
require_once('register_user_form.php');
require_once('valid_data.php');
require_once('db_function.php');
require_once('user_auth.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Log out</title>
</head>

<body>
<?php
session_start();
$old_user==$_SESSION['valid_user'];

//store to test if they *were* logged in
unset($_SESSION['valid_user']);
$result_dest=session_destroy();

if(!empty($old_user))
{
	
	if($result_dest)
	{
	echo' Logged Out.<br />';
	do_html_url('login_in.php','Login');
	}
}
else
{
	//if they weren't logged in but come to this page somehow
	echo'You were not logged in, and so have not been logged out.<br/>';
	do_html_url('login_in.php','Login');
}

?>

</body>
</html>